#ifndef ADAPTER_H
#define ADAPTER_H

#include <iostream>
#include "javabean.h"
using namespace std;

//这个应该是目标接口吧
class Current18v{
public:
    void use18vCurrent(){
        cout<<"使用18v电压"<<endl;
    }
};

class Current220v{
public:
    void use220vCurrent(){
        cout<<"使用220v电压"<<endl;
    }
};

//继承目标接口
class Adapter:public Current18v{
PointerPropertyBuilderByName(Current220v,p220v,private)
public:
    Adapter(Current220v *p220v){
        this->m_p220v=p220v;
    }
    void use18vCurrent(){
        cout<<"adapter 中使用电流"<<endl;
        m_p220v->use220vCurrent();
    }
};

//int main(int argc, char *argv[])
//{
//    Current220v *c220 = new Current220v;
//    Adapter *adpt = new Adapter(c220);
//    adpt->use18vCurrent();
//    delete c220;
//    return 0;
//}

#endif // ADAPTER_H
